package collectionFramework.assignments;

import java.util.Hashtable;
import java.util.Scanner;

public class ProductHashTable {
	public static void main(String args[]) {
		Product p[] = new Product[10];

		Hashtable<String, String> ht = new Hashtable<String, String>();

		Scanner s = new Scanner(System.in);
		for (int i = 0; i < p.length; i++) {
			System.out.print("Enter id:");
			String id = s.next();

			System.out.print("Enter name:");
			String name = s.next();

			p[i] = new Product(id, name);
			ht.put(id, name);
		}
		System.out.println(ht);

		System.out.print("Delete ProductID: ");
		String id = s.next();
		if (ht.contains(id))
			ht.remove(id);
		else
			System.out.println("ProductID " + id + " Not found.");
		System.out.println(ht);
	}
}
